<?php
  
 /**
  * @package JooS
  * @subpackage Syntax_PHPackager
  */

  require_once "JooS/Syntax/Complex/Transition.php";

  class JooS_Syntax_PHPackager_Relations_By_Name extends JooS_Syntax_Complex_Transition {
    /**
     * @return string
     */
    public function compile() {
      $ret = parent::compile();
      if ($ret !== false) {
        $ret = "\$this->getRelationByName('$ret')";
      }
      return $ret;
    }

    /**
     * @return JooS_Syntax_PHPackager_DOM_Name
     */
    public function createRule() {
      $parser = $this->getParser();
      
      return $parser->createSyntax("PHPackager_DOM_Name");
    }
  }
